Field of the Invention
The present invention relates to an image processing apparatus, and in particular to a technique for aligning a plurality of images with one another.
Description of the Related Art
Various methods have been proposed to measure a distance to a subject (subject distance) based on an image acquired by an imaging apparatus, and the depth from defocus (DFD) method is one such method. The DFD method is a method of acquiring a plurality of images having different degrees of a blur by changing the parameters of an imaging optical system, and estimating a subject distance based on the quantity of blur included in the plurality of images. The DFD method allows calculating the distance using only one imaging system, therefore the DFD method can easily be incorporated into the apparatus.
The DFD method needs accurate alignment of a plurality of images taken. Thus, techniques for aligning images with one another have been proposed.
For example, Japanese Patent No. 4340968 discloses an image processing apparatus calculating motion vectors between images, extracting motions of subjects other than moving subjects to estimate affine transformation coefficients, and transforming images based on the affine transformation coefficients to align the images with each other. Furthermore, Japanese Patent Application Laid-open No. 2008-310418 discloses an image processing apparatus that performs alignment by, in addition to aligning non-moving subjects using an affine transformation, calculating the amounts of local misalignment for blocks for motion vectors excluded as moving subjects.